#include <game.h>

base::base(stringc nC)
{
	nameClass = nC;
	initialize = false;
}

base::~base()
{
	
}

int base::init(int i, coeur* c)
{
	mycore=c;
	id = i;
	mylogger = mycore->getLogger();

	logId = mylogger->createFile(nameClass,id);

	initialize = true;
	
	log(nameClass + " initialized");
	return 1;
}

int base::update()
{
	return 1;
}

int base::close()
{
	log(nameClass + " closed");
	mylogger->closeFile(logId);
	initialize = false;
	return 1;
}

int base::getId()
{
	return id;
}

int base::log(stringc text)
{
	mylogger->write(logId,text);
	return 1;
}

bool base::isInit()
{
	return initialize;
}
